#ifndef LOGIN_H
#define LOGIN_H

#include <QtGui/QDialog>
#include <QTcpSocket>
#include <QWidget>
#include "clientHandler.h"
#include "network.h"

namespace Ui {
    class Login;
}

/*! \brief Login:
A class that handles the login UI, if
thedata is vaild or not or if the user
would like to register as a new user.
  */
class Login : public QDialog {
    Q_OBJECT

public:
    /*! Login
   \brief  A constructor for Login
   \param *parent
   */
    Login(QWidget *parent = 0);

    /*! ~Login
   \brief  A deconstructor for Login
   */
    ~Login();

    /*! QString getUsername
   \brief  Retrieve text inputed into QLineEdit username
   \return Returns a QString Users name
  */
    QString getUsername();

    /*! QString getPassword
   \brief  Retrieve text inputed into QLineEdit password
   \return Returns a QSting Users Password
  */
    QString getPassword();

private slots:

    /*! clickedRegister
   \brief  Closes Login window, creates a pointer of
   register window and then shows it.
  */
    void clickedRegister();    

    /*! setInfo
   \brief  Data inputed in Login UI is packaged and
   sent to server for verifcation.
  */
    void setInfo();    

    /*! showBuddyList
   \brief  Closes Login window, creates a pointer of
   Buddylist window and then shows it.
  */
    void showBuddyList();

    /*! statusLabelUpdate
   \brief  If information is incorrect display
   error in Login UI.
  */
    void statusLabelUpdate();

protected:
    /*! ChangeEvent
   \brief  Use to receive the state being changed
   \para
  */
    void changeEvent(QEvent *e);

    /*! keyPressEvent
   \brief  When enter is pressed in Login UI,
   the Login information is sent.
   \para *event
  */
    void keyPressEvent(QKeyEvent *event);

private:    
    Ui::Login *m_ui;

};

#endif // LOGIN_H
